<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>

<!--{hook admin_user_update_start.htm}-->

<div class="row">
	<div class="col-lg-8 offset-lg-2">
		<div class="btn-group m-b-1" role="group">
			<?php echo admin_tab_active($menu['user']['tab'], 'add');?>
		</div>
		<div class="card">
			<div class="card-block">
				<h4 class="card-title">添加用户</h4>
				<form action="<?php echo url("user-add");?>" method="post" id="form">
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">邮箱：</label>
						<div class="col-sm-10">
							<input type="text" id="email" name="email" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">用户名：</label>
						<div class="col-sm-10">
							<input type="text" id="username" name="username" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">登陆密码：</label>
						<div class="col-sm-10">
							<input type="text" id="password" name="password" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">提款密码：</label>
						<div class="col-sm-10">
							<input type="text" id="password_ti" name="password_ti" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">用户组：</label>
						<div class="col-sm-10">
							<select id="group" name="group" class="form-control">
								<option value="0">商户</option>
								<option value="1">代理</option>
								<option value="2">管理员</option>
							</select>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">费率：</label>
						<div class="col-sm-10">
							<input type="text" id="rate" name="rate" class="form-control" value="0.03">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">银行卡号：</label>
						<div class="col-sm-10">
							<input type="text" id="bankcode" name="bankcode" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">银行名称：</label>
						<div class="col-sm-10">
							<input type="text" id="bankname" name="bankname" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">真实姓名：</label>
						<div class="col-sm-10">
							<input type="text" id="name" name="name" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">身份证号：</label>
						<div class="col-sm-10">
							<input type="text" id="id" name="id" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">手机号：</label>
						<div class="col-sm-10">
							<input type="text" id="mobile" name="mobile" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">QQ号：</label>
						<div class="col-sm-10">
							<input type="text" id="qq" name="qq" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">网站名称：</label>
						<div class="col-sm-10">
							<input type="text" id="sitename" name="sitename" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">网站地址：</label>
						<div class="col-sm-10">
							<input type="text" id="sitelink" name="sitelink" class="form-control">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">IP白名单：</label>
						<div class="col-sm-10">
							<input type="text" id="allow_ips" name="allow_ips" class="form-control" placeholder="多个地址用,号分隔 留空为不限制">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label">银行开关：</label>
						<div class="col-sm-10">
							<select id="bank_open" name="bank_open" class="form-control">
								<option value="1">开</option>
								<option value="0">关</option>
							</select>
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 form-control-label"></label>
						<div class="col-sm-10">
							<button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="提交中...">确认</button>
							<a role="button" class="btn btn-secondary btn-block m-t-1" href="javascript:history.back();">返回</a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

<!--{hook admin_user_update_end.htm}-->

<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>


<script>
var jform = $('#form');
var jsubmit = $('#submit');
jform.on('submit', function() {
	jform.reset();
	jsubmit.button('loading');
	var postdata = jform.serialize();
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			$.alert(message);
			jsubmit.text(message).delay(3000).button('reset');
		} else if(code < 0) {
			$.alert(message);
			jsubmit.button('reset');
		} else {
			alert(message);
			jform.find('[name="'+code+'"]').alert(message).focus();
			jsubmit.button('reset');
		}
	});
	return false;
});

$('#nav_pc li.user, #nav_mobile li.user').tab('show');

</script>